<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>分配主推任务</title>
        <link rel="stylesheet" href="css/reset.css" />
        <link rel="stylesheet" href="css/platform.css" />
        <link rel="stylesheet" href="css/table.css" />
        <link rel="stylesheet" href="js/ui/jquery-ui.min.css" />
        <link rel="stylesheet" href="css/mainpush.css" />
    </head>

    <body>
        <div class="container add-task" ms-controller="mainController">
            <div class="header">
                <div class="u-title" ms-if="operateStatus!=0">分配主推任务</div>
                <div class="u-title" ms-if="operateStatus==0">查看主推任务</div>
            </div>
            <div class="cnt-box">
                <div class="u-multiform">
                    <div class="column">
                        <div class="cell">
                            <label>任务主题：</label>
                            <span class="read-txt">{{taskTopic}}</span>
                        </div>
                        <div class="cell">
                            <label>任务时间：</label>
                            <div class="cnt-box">
                                <span class="read-txt">{{startTime | date("yyyy-MM-dd")}}</span>
                                <span class="split">~</span>
                                <span class="read-txt">{{endTime | date("yyyy-MM-dd")}}</span>
                            </div>
                        </div>
                    </div>
                    <div class="column">
                        <div class="cell">
                            <label>主推品类：</label>
                            <div class="cnt-box">
                                <span class="read-txt">{{categoryNameTxt}}</span>
                            </div>
                        </div>
                    </div>
                    <div class="column">
                        <div class="cell">
                            <label>总目标占比：</label>
                            <div class="cnt-box">
                                <span class="read-txt">{{percent}}%</span>
                            </div>
                        </div>
                        <div ms-if="taskStatus==1" class="cell">
                            <label>已完成占比：</label>
                            <div class="cnt-box">
                                <span class="read-txt">{{compltPercent}}%</span>
                            </div>
                        </div>
                    </div>
                    <div ms-if="taskStatus==1" class="column">
                        <div class="cell">
                            <label>总目标数量：</label>
                            <div class="cnt-box">
                                <span class="read-txt">{{totalNum}}</span>
                            </div>
                        </div>
                        <div class="cell">
                            <label>已完成数量：</label>
                            <div class="cnt-box">
                                <span class="read-txt">{{compltNum}}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="cnt push-goods">
                <div class="cnt-box" ms-if="operateStatus!=0">                
                    <button class="u-btn small import-task" ms-click="importXls">导入分配结果</button>
                    <a href="javascript:;" class="temp-download" ms-click="downloadtemp">模板下载</a>
                </div>
                <div id="taskTable" ms-controller="taskTable"></div>
                <script type="avalon" id="tabletask">
                    <div class="tableWrapper">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th class="new-msg"></th>
                                    <th class="align-left">商品类型</th>
                                    <th>商品型号</th>
                                    <th>商品编码</th>
                                    <th>目标台数</th>
                                    <th ms-if="taskStatus==1">已完成数量</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ms-repeat-row="sources" ms-class="dis:row.commStatus==0">
                                    <td class="new-msg"><span ms-if="row.commStatus==3">●</span></td>
                                    <td class="align-left">
                                        {{row.commType}}
                                    </td>
                                    <td>{{row.commName}}</td>
                                    <td>{{row.commCodes}}</td>
                                    <td>{{row.destNum}}</td>
                                    <td ms-if="taskStatus==1">{{row.compltNum}}</td>
                                    <td ms-if="operateStatus!=0" class="operate">
                                        <a href="javascript:;" ms-if="row.assignStatus==1 && (row.commStatus==1 || row.commStatus==3)" ms-click="customFuncs.distributionInfo(row.commClassifyCode,row.destNum)">分配</a>
                                        <a href="javascript:;" ms-if="row.assignStatus==2 && (row.commStatus==1 || row.commStatus==3)" ms-click="customFuncs.distributionInfo(row.commClassifyCode,row.destNum)">分配详情</a>
                                        <span ms-if="row.commStatus==0">/</span>
                                    </td>
                                    <td ms-if="operateStatus==0" class="operate">
                                        <a href="javascript:;" ms-click="customFuncs.distributionInfo(row.commClassifyCode,row.destNum)">分配详情</a>
                                    </td>
                                </tr>
                            </tbody>
                            <tfoot>
                                <tr>
                                    <td colspan="8">
                                        <div class="pager">
                                            <div class="first-page" ms-click="firstpage" ms-class={{firstpagestyle}}>首页</div>
                                            <div class="pre-page" ms-click="prepage" ms-class={{prepagestyle}}>上一页</div>
                                            <div class="current-page">
                                                第<input class="current-page-num" type="text" ms-duplex="currentpage" ms-input="jumppage" />页
                                                <span class="totalpage">共 {{totalpage}} 页</span>
                                            </div>
                                            <div class="next-page" ms-click="nextpage" ms-class={{nextpagestyle}}>下一页</div>
                                            <div class="last-page" ms-click="lastpage" ms-class={{lastpagestyle}}>尾页</div>
                                            <div class="messageinfo">{{startrow}}-{{endrow}} 共{{total}}条</div>
                                        </div>
                                    </td>
                                </tr>
                            </tfoot>
                        </table>
                    </div>
                </script>
                <!--<div class="task-operate">
                    <button class="u-btn" ms-click="saveComm">保存</button>
                </div>-->
            </div>
        </div>
        <div ms-controller="popController">
            <div class="u-popup" id="popup_import">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert import">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">选择导入文件</p>
                            <div class="container">
                                <form id="form_file" enctype="multipart/form-data" autocomplete="off" method="post">
                                    <input type="file" name="upfile" accept=".xls,.xlsx" id="upladFile" />
                                    <input type="hidden" name="taskNo" ms-attr-value="taskNo" />
                                </form>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn" ms-click="uploadFile">确定</button>
                                <button class="u-btn btn-close gray">取消</button>
                            </div>
                            <div id="load-import" class="loadData">
                                <div class="la-ball-spin-clockwise-fade">
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup distribution" id="popup_distribution">
                <div class="bg"></div>
                <div class="asTable-box">
                    <div class="asTable">
                        <div class="asTableCell">
                            <div class="asCell dialog">
                                <a href="javascript:;" class="close btn-close">×</a>
                                <p class="title">分配详情</p>
                                <div class="container">
                                    <div class="search-code">
                                        <input class="u-ipt" placeholder="输入门店编码" maxlength="4" ms-duplex="searchcode" onkeyup="fastSearch(event)" ms-blur="fastSearch"/>
                                        <button class="u-btn" ms-click="fastSearch">快速定位</button>
                                        <div class="err-box">
                                            <p class="u-error">请输入4位门店编码</p>
                                        </div>
                                    </div>
                                    <p class="total">总目标数量：<span class="all">{{alldestnum}}</span> 总分配数量：<span>{{curdestnum}}</span></p>
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>门店编码</th>
                                                <th>门店名称</th>
                                                <th>目标数量</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ms-repeat-row="assignList">
                                                <td class="region-code" ms-attr-id="td_{{row.orgCode}}"><span>{{row.orgCode}}</span></td>
                                                <td>{{row.orgName}}</td>
                                                <td class="edit-ipt">
                                                    <span ms-if="operateStatus==0">{{row.destNum}}</span>
                                                    <input ms-if="operateStatus!=0" class="u-ipt" maxlength="7" ms-attr-value="row.destNum" ms-blur="checkNum" />
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <div id="load-assign" style="display: none;">
                                        <div class="la-ball-spin-clockwise-fade">
                                            <div></div>
                                            <div></div>
                                            <div></div>
                                            <div></div>
                                            <div></div>
                                            <div></div>
                                            <div></div>
                                            <div></div>
                                        </div>
                                    </div>
                                </div>
                                <div ms-if="operateStatus!=0" class="btn-box">
                                    <button class="u-btn" ms-click="saveRegionComm">保存</button>
                                    <button class="u-btn gray btn-close">取消</button>
                                </div>
                                <div ms-if="operateStatus==0" class="btn-box">
                                    <button class="u-btn btn-close">确定</button>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup" id="popup_tips">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="error"></div>
                                <p></p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn btn-close">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="loadData">
            <div class="la-ball-spin-clockwise-fade">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>
        <script src="js/jquery.min.js"></script>
        <script src="js/avalon.shim.sn.js"></script>
        <script src="js/ui/jquery-ui.min.js"></script>
        <script src="js/ui/jquery-ui-timepicker-addon.js"></script>
        <script src="js/jquery.form.js"></script>
        <script src="js/swift-ui-table-1.1.js"></script>
        <script src="js/platform.js"></script>
        <script src="js/DataInterface/DataInterface.js"></script>
        <script src="js/edittask-region.js?v=20160606"></script>
        
	</body>
</html>
